<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      py:strip="">

  <py:match path="head" once="true"><head>
    <title>Preferences: ${select('title/text()')}</title>
    ${select("*[local-name() != 'title']")}
  </head></py:match>

  <py:match path="body" once="true" buffer="false"><body>
    <div id="content" class="prefs">
      <h1>Preferences</h1>
      <p>This page lets you customize your personal settings for this site.
      These settings are stored on the server and are identified by a session
      key stored in a browser cookie. That cookie allows your settings to be
      restored on subsequent visits.</p>
      <ul id="tabs">
        <li py:for="name, label in sorted(filter(lambda p: p[1]!= 'General', panels))"
            class="${name == active_panel and 'active' or None}"
            id="${name and ('tab_%s' % name) or None}">
          <a py:strip="name == active_panel" href="${href.prefs(name)}">${label}</a>
        </li>
      </ul>
      <div id="tabcontent">
        <py:with vars='content=str(select("*|text()"))'>       
        
        <py:choose test="">
            <py:when test="len(content)==0">
               <py:if test="req.authname and req.authname != 'anonymous'">
               to change your email go <a href="/accounts/change_email/">here</a> 
               </py:if>
            </py:when>
  
            <py:otherwise>
                <form id="userprefs" action="" method="post">
                  ${Markup(content)} 
                  <div class="buttons">
                    <input type="hidden" name="action" value="save" />
                    <input type="submit" value="${_('Save changes')}" />
                  </div >
                </form>               

            </py:otherwise>
        </py:choose>

        </py:with>
        
      </div>
    </div>

  </body></py:match>

  <xi:include href="layout.html" />
</html>
